/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package SM.impl;

import SM.MAT;
import SM.SMPackage;
import SM.State;

import SM.Transition;
import java.util.Collection;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>MAT</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link SM.impl.MATImpl#getEtats <em>Etats</em>}</li>
 *   <li>{@link SM.impl.MATImpl#getTrans <em>Trans</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class MATImpl extends EObjectImpl implements MAT {
	/**
	 * The cached value of the '{@link #getEtats() <em>Etats</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEtats()
	 * @generated
	 * @ordered
	 */
	protected EList<State> etats;
	/**
	 * The cached value of the '{@link #getTrans() <em>Trans</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTrans()
	 * @generated
	 * @ordered
	 */
	protected EList<Transition> trans;
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected MATImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return SMPackage.Literals.MAT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<State> getEtats() {
		if (etats == null) {
			etats = new EObjectResolvingEList<State>(State.class, this, SMPackage.MAT__ETATS);
		}
		return etats;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Transition> getTrans() {
		if (trans == null) {
			trans = new EObjectResolvingEList<Transition>(Transition.class, this, SMPackage.MAT__TRANS);
		}
		return trans;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case SMPackage.MAT__ETATS:
				return getEtats();
			case SMPackage.MAT__TRANS:
				return getTrans();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case SMPackage.MAT__ETATS:
				getEtats().clear();
				getEtats().addAll((Collection<? extends State>)newValue);
				return;
			case SMPackage.MAT__TRANS:
				getTrans().clear();
				getTrans().addAll((Collection<? extends Transition>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case SMPackage.MAT__ETATS:
				getEtats().clear();
				return;
			case SMPackage.MAT__TRANS:
				getTrans().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case SMPackage.MAT__ETATS:
				return etats != null && !etats.isEmpty();
			case SMPackage.MAT__TRANS:
				return trans != null && !trans.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //MATImpl
